package cn.yuanqiao.archive.storeRoom.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 上下架日志对象 YQUPDOWN_WAREHOUSE
 * 
 * @author xy
 * @date 2023-06-30
 */
public class UpDownLogs extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQUPDOWN_WAREHOUSE";

    public UpDownLogs() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            //throw new ServiceException("tenantCode is null");
            this.tableName="YQUPDOWN_WAREHOUSE";
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** id */
    @IdAnnotation
    private Long id;

    /** 档案Id */
    @Excel(name = "档案Id")
    private Long daId;

    /** 分表名称 */
    @Excel(name = "分表名称")
    private String subTableName;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long creator;

    /** 最后修改人 */
    @Excel(name = "最后修改人")
    private Long lastupdater;

    /** 最后修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastupdateTime;

    /** 题名 */
    @Excel(name = "题名")
    private String title;

    /** 档号 */
    @Excel(name = "档号")
    private String dh;

    /** 上下架类型 */
    @Excel(name = "上下架类型")
    private String type;

    /** 上下架日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上下架日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date sxjrq;

    /** 下架原因 */
    @Excel(name = "下架原因")
    private String xjyy;

    /** 库房名称 */
    @Excel(name = "库房名称")
    private String storeName;

    /** 库房code */
    @Excel(name = "库房code")
    private String storeCode;

    /** 上下架工作人员 */
    @Excel(name = "上下架工作人员")
    private String sxjgzry;

    private String tableName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date edCreateTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setDaId(Long daId) 
    {
        this.daId = daId;
    }

    public Long getDaId() 
    {
        return daId;
    }
    public void setSubTableName(String subTableName) 
    {
        this.subTableName = subTableName;
    }

    public String getSubTableName() 
    {
        return subTableName;
    }
    public void setCreator(Long creator) 
    {
        this.creator = creator;
    }

    public Long getCreator() 
    {
        return creator;
    }
    public void setLastupdater(Long lastupdater) 
    {
        this.lastupdater = lastupdater;
    }

    public Long getLastupdater() 
    {
        return lastupdater;
    }
    public void setLastupdateTime(Date lastupdateTime) 
    {
        this.lastupdateTime = lastupdateTime;
    }

    public Date getLastupdateTime() 
    {
        return lastupdateTime;
    }
    public void setTitle(String title) 
    {
        this.title = title;
    }

    public String getTitle() 
    {
        return title;
    }
    public void setDh(String dh) 
    {
        this.dh = dh;
    }

    public String getDh() 
    {
        return dh;
    }
    public void setType(String type) 
    {
        this.type = type;
    }

    public String getType() 
    {
        return type;
    }
    public void setSxjrq(Date sxjrq) 
    {
        this.sxjrq = sxjrq;
    }

    public Date getSxjrq() 
    {
        return sxjrq;
    }
    public void setXjyy(String xjyy) 
    {
        this.xjyy = xjyy;
    }

    public String getXjyy() 
    {
        return xjyy;
    }
    public void setStoreName(String storeName) 
    {
        this.storeName = storeName;
    }

    public String getStoreName() 
    {
        return storeName;
    }
    public void setStoreCode(String storeCode) 
    {
        this.storeCode = storeCode;
    }

    public String getStoreCode() 
    {
        return storeCode;
    }
    public void setSxjgzry(String sxjgzry) 
    {
        this.sxjgzry = sxjgzry;
    }

    public String getSxjgzry() 
    {
        return sxjgzry;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Date getEdCreateTime() {
        return edCreateTime;
    }

    public void setEdCreateTime(Date edCreateTime) {
        this.edCreateTime = edCreateTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("daId", getDaId())
            .append("subTableName", getSubTableName())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
            .append("lastupdater", getLastupdater())
            .append("lastupdateTime", getLastupdateTime())
            .append("title", getTitle())
            .append("dh", getDh())
            .append("type", getType())
            .append("sxjrq", getSxjrq())
            .append("xjyy", getXjyy())
            .append("storeName", getStoreName())
            .append("storeCode", getStoreCode())
            .append("remark", getRemark())
            .append("sxjgzry", getSxjgzry())
            .toString();
    }
}
